import request from '@/utils/request'

/*
* 获取树状机构信息接口
*  */
export const fetchInstitutionTreeAPI = () => {
  return request({
    url: '/manager/business-hall/tree',
    method: 'GET'
  })
}

/*
* 获取员工分页数据接口
* */
export const fetchEmployeeListAPI = (params) => {
  return request({
    url: '/manager/business-hall/user/page',
    method: 'GET',
    params: params
  })
}

/*
* 获取机构详情接口
*  */
export const fetchInstitutionDetailAPI = (id) => {
  return request({
    url: `/manager/business-hall/${id}`,
    method: 'GET'
  })
}

/*
*根据父id获取地址信息接口
*  */
export const fetchAddressListAPI = (parentId) => {
  return request({
    url: '/manager/areas/children',
    method: 'GET',
    params: {
      parentId
    }
  })
}

/*
* 编辑机构信息的接口
*  */
export const updateInstitutionAPI = (data) => {
  return request({
    url: '/manager/business-hall',
    method: 'POST',
    data
  })
}
